package org.yaglyf.service;

import com.alibaba.dubbo.common.json.JSON;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.yaglyf.api.entity.UserInfo;
import org.yaglyf.api.service.UserInfoService;
import org.yaglyf.core.itf.ITestCache;
import org.yaglyf.mapper.UserInfoMapper;

import java.io.IOException;

/**
 * Created by yaq on 2016/9/13.
 */
@Service
@org.springframework.stereotype.Service("userInfoService")
public class UserInfoServiceImpl implements UserInfoService {
    @Autowired
    private UserInfoMapper userInfoMapper;
    @Autowired
    private ITestCache testCache;

    @Override
    public void testINFO() throws IOException {
//        testCache.test11();
//        testCache.test11();
//        testCache.test11();
        UserInfo userInfo = userInfoMapper.selectByPrimaryKey(1);
         userInfo = userInfoMapper.selectByPrimaryKey(2);
         userInfo = userInfoMapper.selectByPrimaryKey(3);
         userInfo = userInfoMapper.selectByPrimaryKey(4);
         userInfo = userInfoMapper.selectByPrimaryKey(5);
         //userInfo = userInfoMapper.selectByPrimaryKey(10);
        userInfo.setSalt("aaaaaa");
        userInfoMapper.updateByPrimaryKey(userInfo);

        System.out.println(JSON.json(userInfo));
//        UserInfo info = new UserInfo();
//        info.setUrseName("test");
//        info.setUserPassword("test");
//        info.setSalt("salt");
//        info.setUrlId(1111);
//        userInfoMapper.insertSelective(info);
    }
}
